package com.mexico.inloancash.bean;

import java.util.List;

public class India_Billing_ListBean {

    /**
     * code : 200
     * msg : success
     * data : [{"id":276,"orderno":"202011282037469611692820","amount":"1500000.00","damount":"1050000.00","pay_amount":"1530000.00","service_fee":"450000.00","interestrate":"0.02","overdue_days":0,"overduefee":"0.00","days":7,"deadline":0,"delay_time":0,"status":1,"addtime":1606567066,"coupon_amount":"0.00","confirmstatus":1}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 276
         * orderno : 202011282037469611692820
         * amount : 1500000.00
         * damount : 1050000.00
         * pay_amount : 1530000.00
         * service_fee : 450000.00
         * interestrate : 0.02
         * overdue_days : 0
         * overduefee : 0.00
         * days : 7
         * deadline : 0
         * delay_time : 0
         * status : 1
         * addtime : 1606567066
         * coupon_amount : 0.00
         * confirmstatus : 1
         */

        private int id;
        private String orderno;
        private String amount;
        private String damount;
        private String pay_amount;
        private String service_fee;
        private String interestrate;
        private int overdue_days;
        private String overduefee;
        private int days;
        private int deadline;
        private int delay_time;
        private int status;
        private int addtime;
        private double coupon_amount = 0.0;
        private int confirmstatus;

        /**
         * 是否为优惠卷
         * <p>
         * 优惠为>0
         *
         * @return
         */
        public boolean isCoupon() {
            return isLoan() && coupon_amount > 0;
        }

        /**
         * 是否已经放款
         * <p>
         * 已放款，5-已逾期，7-延期
         *
         * @return
         */
        public boolean isLoan() {
            if (status == 4) return true;
            if (status == 5) return true;
            if (status == 7) return true;
            return false;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getOrderno() {
            return orderno;
        }

        public void setOrderno(String orderno) {
            this.orderno = orderno;
        }

        public String getAmount() {
            return amount;
        }

        public void setAmount(String amount) {
            this.amount = amount;
        }

        public String getDamount() {
            return damount;
        }

        public void setDamount(String damount) {
            this.damount = damount;
        }

        public String getPay_amount() {
            return pay_amount;
        }

        public void setPay_amount(String pay_amount) {
            this.pay_amount = pay_amount;
        }

        public String getService_fee() {
            return service_fee;
        }

        public void setService_fee(String service_fee) {
            this.service_fee = service_fee;
        }

        public String getInterestrate() {
            return interestrate;
        }

        public void setInterestrate(String interestrate) {
            this.interestrate = interestrate;
        }

        public int getOverdue_days() {
            return overdue_days;
        }

        public void setOverdue_days(int overdue_days) {
            this.overdue_days = overdue_days;
        }

        public String getOverduefee() {
            return overduefee;
        }

        public void setOverduefee(String overduefee) {
            this.overduefee = overduefee;
        }

        public int getDays() {
            return days;
        }

        public void setDays(int days) {
            this.days = days;
        }

        public int getDeadline() {
            return deadline;
        }

        public void setDeadline(int deadline) {
            this.deadline = deadline;
        }

        public int getDelay_time() {
            return delay_time;
        }

        public void setDelay_time(int delay_time) {
            this.delay_time = delay_time;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public int getAddtime() {
            return addtime;
        }

        public void setAddtime(int addtime) {
            this.addtime = addtime;
        }

        public double getCoupon_amount() {
            return coupon_amount;
        }

        public void setCoupon_amount(double coupon_amount) {
            this.coupon_amount = coupon_amount;
        }

        public int getConfirmstatus() {
            return confirmstatus;
        }

        public void setConfirmstatus(int confirmstatus) {
            this.confirmstatus = confirmstatus;
        }
    }
}
